import { request } from '@ruifox-cms/utils'

//评价课程
export function ratingSubmit(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/rating',
    method: 'post',
    data
  })
}
//课程评价分页
export function ragingPaging(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/ragingPaging',
    method: 'post',
    data
  })
}
//课程实例评价分页
export function ratingItemPaging(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/ratingItemPaging',
    method: 'post',
    data
  })
}
//获取课程总评分
export function ratingCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating',
    method: 'post',
    data
  })
}
//获取课程评价详情
export function getCourseRatingDetail(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/getCourseRatingDetail',
    method: 'get',
    params
  })
}
//获取课程实例评分
export function getCourseInstanceRating(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/getCourseInstanceRating',
    method: 'get',
    params
  })
}
//删除评价条目
export function deleteRatingItem(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/deleteRatingItem',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//查询用户当前实例评价
export function getMyRating(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/rating/getMyRating',
    method: 'get',
    params
  })
}